import request from '@/utils/request'

// 查询行程内容列表
export function listContent(query) {
  return request({
    url: '/travel/schedule/content/list',
    method: 'get',
    params: query
  })
}

// 查询行程内容详细
export function getContent(scheduleId) {
  return request({
    url: '/travel/schedule/content/' + scheduleId,
    method: 'get'
  })
}

// 新增行程内容
export function batchSaveScheduleContent(data) {
  return request({
    url: '/travel/schedule/content',
    method: 'post',
    data: data
  })
}
/*
    @Override
    public void insertTravelScheduleContent(List<TravelScheduleContent> travelScheduleContent)
    {
        //更新行程内容的时候也要更新行程表的更新时间
        travelScheduleMapper.selectTravelScheduleByScheduleId(travelScheduleContent.get(0).getScheduleId()).setUpdateTime(DateUtils.getNowDate());
        travelScheduleMapper.updateTravelSchedule(travelScheduleMapper.selectTravelScheduleByScheduleId(travelScheduleContent.get(0).getScheduleId()));
        for(TravelScheduleContent tsc:travelScheduleContent){

            tsc.setCreateTime(DateUtils.getNowDate());
            travelScheduleContentMapper.insertTravelScheduleContent(tsc);
        }
    }

 */
// 修改行程内容
export function updateContent(data) {
  return request({
    url: '/travel/schedule/content',
    method: 'put',
    data: data
  })
}

// 删除行程内容
export function delAllContent(scheduleId) {
  return request({
    url: '/travel/schedule/content/' + scheduleId,
    method: 'delete'
  })
}
